Ext.define('WT.view.desktop.rolemanager.CreateRoleView',{
	extend:'Ext.window.Window',
	id:'create-role-win',
	//显示此窗口时遮罩其他组件
	modal:true,
	autoShow:true,
	title:'创建角色',
	width:800,
	height:500,
	layout:'fit',
	items:[{
		layout : 'card',
		activeItem : 0,
		defaults: {border: false},
		
		//card bbar start
		bbar: ['->',{
			id: 'move-prev',
			text: '上一页',
			handler: function(btn) {
				WT.view.desktop.rolemanager.CreateRoleView.navigate(btn.up("panel"), "prev");
			},
			disabled: true,
			iconCls:'create-user-pre'
			},
			'-',
			{
			id: 'move-next',
			text: '下一页',
			iconCls:'create-user-next',
			handler: function(btn) {
				WT.view.desktop.rolemanager.CreateRoleView.navigate(btn.up("panel"), "next");
			}},'-',
			{
				id:'move-finsh',
				text:'完成',
				iconCls:'create-user-finsh',
				disabled: true
			
			},'-',{
				text:'取消',
				iconCls:'remove',
				id:'cancel'
			    
			}],
	    //card bbar end
			
	    //card items start
		items:[
		    
		    //第一个面板开始
		    {
			defaults: {
        	labelSeparator :'：',
        	labelWidth : 60,
        	width:230
        	},
   			defaultType: 'textfield',
   			bodyStyle: {  
                padding: '15px'  //内间距 
            },
            // form start
            items: [
                    {
                    	 fieldLabel: '角色名',
                         name: 'roleName',
                         style:'font-size:15px',
                         allowBlank:false
                         
                    },
                    {
                    	xtype:'textarea',
                        name:'mark',
                        fieldLabel: '备注',
                        width:400  
                    }
                    
                ]
                
            // form end
            
		},
		//第一个面板结束
		
		//第二个面板开始
		{
			border: false,
            xtype: 'grid',
           
          //dockedItems start
            dockedItems:[{    
                       	 dock:'bottom',    
                       	 xtype:'pagingtoolbar',    
                       	 displayInfo:true,    
                       	 displayMsg:'显示{0}-{1}条，共计{2}条',    
                       	 emptyMsg:'没有数据'    
                        }],
           //dockedItems end   
                        
           
            selModel: new Ext.selection.CheckboxModel,
           
            //columns start
            columns: [
                {
                    text: "用户名",
                    flex:1,
                    sortable: true,
                    dataIndex: 'roleName'
                },
                {
                    text: "描述",
                    width: 150,
                    sortable: true,
                    dataIndex: 'mark'
                }]
          //columns end
		},
		//第二个面板结束
		
		//第三个面板开始
		{
			border: false,
            xtype: 'grid',
            
           
           
          //dockedItems start
            dockedItems:[{    
                       	 dock:'bottom',    
                       	 xtype:'pagingtoolbar',    
                       	 displayInfo:true,    
                       	 displayMsg:'显示{0}-{1}条，共计{2}条',    
                       	 emptyMsg:'没有数据'    
                        },{
                        	xtype: 'toolbar',
                        	items:[{
                        		 text:'添加权限',
                                 tooltip:'添加权限',
                                 iconCls:'add',
                                 xtype:'button'
                        	}]
                        }],
           //dockedItems end   
                        
           
            selModel: new Ext.selection.CheckboxModel,
           
            //columns start
            columns: [
                {
                    text: "权限名",
                    flex:1,
                    sortable: true,
                    dataIndex: 'roleName'
                },
                {
                    text: "描述",
                    width: 150,
                    sortable: true,
                    dataIndex: 'mark'
                }]
          //columns end
		}
		//第三个面板结束
		]
		//card items end
	}],
	statics:{
		navigate:function(panel, direction){
        	var layout = panel.getLayout();
        	layout[direction]();
        	Ext.getCmp('move-prev').setDisabled(!layout.getPrev());
        	Ext.getCmp('move-next').setDisabled(!layout.getNext());
        	Ext.getCmp('move-finsh').setDisabled(!layout.getPrev());
        	}
	}
});